package com.ztesoft.book.core.quartz.schedulejob.dto;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ztesoft.book.core.base.base.dto.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

/**
 * @Description: 定时任务实体类
 * @Author: YangFan
 * @Date: 2021-03-19 16:47
 */
@Data
@TableName("schedule_job")
@EqualsAndHashCode(callSuper = true)
public class ScheduleJobDTO extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 任务调度参数Key
     */
    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";


    /**
     * 构造方法
     */
    public ScheduleJobDTO(@NotBlank(message = "定时器来源模块不能为空") String source, @NotBlank(message = "bean名称不能为空") String beanName, String params, String funParams, @NotBlank(message = "cron表达式不能为空") String cronExpression, Integer status, String remark) {
        this.source = source;
        this.beanName = beanName;
        this.params = params;
        this.funParams = funParams;
        this.cronExpression = cronExpression;
        this.status = status;
        this.remark = remark;
    }

    /**
     * 空构造方法
     */
    public ScheduleJobDTO() {
    }

    /**
     * SpringBean名称
     */
    @NotBlank(message = "定时器来源模块不能为空")
    private String source;


    /**
     * SpringBean名称
     */
    @NotBlank(message = "bean名称不能为空")
    private String beanName;

    /**
     * 参数
     */
    private String params;

    /**
     * 方法参数
     */
    private String funParams;

    /**
     * Cron表达式
     */
    @NotBlank(message = "cron表达式不能为空")
    private String cronExpression;

    /**
     * 任务状态
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;


}